package com.zgm.ch04.applicationContext.event._9_8;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

public class MessageEventListener implements ApplicationListener {
	
	public void onApplicationEvent(ApplicationEvent event){
		if(event instanceof MessageEvent){
			MessageEvent messageEvent = (MessageEvent) event;
			
			System.out.println("从" + messageEvent.getSource() + " 接收到" + messageEvent.getMessage());
		}
		
	}

}
